package com.chixing.controller;

import com.chixing.commons.ServerResponse;
import com.chixing.commons.TokenUtil;
import com.chixing.pojo.EducationalExperience;
import com.chixing.pojo.ExperienceProject;
import com.chixing.pojo.LoginPerson;
import com.chixing.pojo.PersonCenter;
import com.chixing.service.IExperienceProjectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * <p>
 * 项目经历 前端控制器
 * </p>
 *
 * @author Jason Marslyon
 * @since 2022-10-04
 */
@RestController
@RequestMapping("experCienceProject")
public class ExperienceProjectController {
    @Autowired
    private IExperienceProjectService projectService;

    //    通过mresumeId获取educationalExperience表信息，并返回
    @RequestMapping("/getProjectByreId")
    public ServerResponse getProByMyresumeId(@RequestParam("resumeId") Integer resumeId) {
        ExperienceProject project = projectService.getProjectById(resumeId);
        return ServerResponse.success("查询项目表成功", project);
    }
    //更新ExperienceProject表
    @RequestMapping("updateProject/{myResumeId}")
    public ServerResponse updateProject(ExperienceProject experienceProject, @PathVariable("myResumeId") Integer myResumeId){

        ServerResponse serverResponse = projectService.updateProjectById(experienceProject,myResumeId);
        return serverResponse;
    }
}
